<!--首页推荐歌单模块-->
<template>
  <div class="recommendMusic">
    <div class="header">
      <h4 class="title">{{recomend.uiElement.subTitle.title}}</h4>
      <span class="more">{{recomend.uiElement.button.text}}<van-icon name="arrow" /></span>
    </div>
    <div class="content">
      <div class="scroll" :style="{ width: w + 'vw' }">
        <div
          class="item"
          v-for="item in recomend.creatives"
          :key="item.creativeId"
        >
          <div class="cover">
            <img :src="item.uiElement.image.imageUrl" alt="" />
          </div>
          <div class="mainTitle">{{ item.uiElement.mainTitle.title }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["recomend"],
  data() {
    return {
      w: null,
    };
  },
  created() {
    this.w = this.recomend.creatives.length * 30;
  },
};
</script>

<style lang="less" scoped>
.recommendMusic {
  padding: 0 2.666vw;
  background: #fff;
  margin-bottom: 2.666vw;
  .header {
    padding: 2.666vw 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .more {
      color: #474747;
      border: 2px solid #f6f6f6;
      padding: 1vw 1.5vw;
      display: flex;
      align-items: center;
      font-size: 12px;
      border-radius: 15px;
    }
  }
  .content {
    overflow-x: scroll;
    .scroll {
      display: flex;
      padding: 2.666vw 0;
      .item {
        width: 30vw;
        margin: 0 2vw;
        .cover {
          img {
            width: 100%;
            border-radius: 8px;
          }
        }
        .mainTitle {
          overflow: hidden;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 2;
        }
      }
    }
  }
}
</style>